
<%@page import="BLL.BCategory"%>
<%@page import="DTO.Category"%>

<%@page import="java.util.ArrayList"%>

<html>
    <head>
        
        <link href="css/style.css" type="text/css" rel="stylesheet">
    </head>
    <body>
        
        <table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="top" style="padding-bottom:0px;">
       <div style="text-transform:uppercase; color:#175b96; padding-bottom:10px" class="title" valign="top">
          Danh Muc San Pham
       </div>
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
<script language="javascript">
function dropCategory(obj){
	if(document.getElementById(obj).style.display == ""){		
		document.getElementById(obj).style.display = "none";
		document.frmTemp.objdrop.value = "none";	
	}
	else{
		document.getElementById(obj).style.display = "";
		//document.frmTemp.objdrop.value = obj.id;
	}
}

</script>
<tbody>
    <%
    ArrayList<Category> categories = new BCategory().getRoot();
    
    for(Category category : categories)
           {
    	if(category.getParent() == 0)
        %>
        <tr height="28" onClick="JavaScript:dropCategory(<%=category.getCategoryId()%>);">							
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr style="cursor:pointer;">
<td style="padding-right:10px"><img src="images/icon.gif"></td>
<td id="a65" width="100%" align="left" class="title" style="padding-top:3; padding-bottom:3; color: 004c93" nowrap="nowrap"><%=category.getName()%></td>	
<td width="0" id="top65"></td>							
</tr>								
</tbody></table>	
</td>							
</tr>
<tr id="<%=category.getCategoryId()%>" height="28" style="display: none;">
    
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
    
    <%
    ArrayList<Category> childCategoies = new BCategory().getByParent(category.getCategoryId());
   
    for(Category childCategory : childCategoies)
           {
%>
    <tr>
<td align="left" style="padding-left:10px; padding-right:10px"><img src="images/iconsub.gif"></td>
<td id="22" align="left" nowrap="nowrap"><a href="index.jsp?categoryId=<%=childCategory.getCategoryId()%>" class="content" style="font-size:12px;" id="a22"><%=childCategory.getName()%></a></td>
<td width="100%">&nbsp;</td>
</tr>
    <%
}
%>
</tbody>
</table>
</td>							
</tr>
    <%
}
%>
</tbody></table>


</td></tr></tbody></table>

    </body>
</html>
